using System.ComponentModel;
using System.Xml.Serialization;
using uTILLIty.Rave.Contract.Configuration;
using uTILLIty.Rave.Core.Schema;

namespace uTILLIty.Rave.Core.StorageAdapter
{
	/// <summary>
	/// Additional information required by the <see cref="NtfsStorageAdapter"/> to be able to create
	/// a group.
	/// </summary>
	/// <remarks>
	/// This information is extracted from the <see cref="CreationConfiguration.Data"/> property.
	/// </remarks>
  [XmlRoot(Namespace = WellKnownSchemas.RaveNtfsConfiguration, IsNullable = false)]
  public class GroupCreationConfiguration
  {
    /// <summary>
    /// Optional. <see cref="Member.Identifier"/> is used, if this is not set
    /// </summary>
    [DefaultValue("")]
    public string DisplayName { get; set; }

		/// <summary>
		/// The description to be set for the group
		/// </summary>
    public string Description { get; set; }

		/// <summary>
		/// The OU to create the group in
		/// </summary>
    public string CreationOU { get; set; }
    
		/// <summary>
		/// The <see cref="GroupScope">scope</see> of the group
		/// </summary>
		[XmlAttribute("scope")]
		public GroupScope Scope { get; set; }
		
		/// <summary>
		/// The <see cref="GroupType">type</see> of the group
		/// </summary>
		[XmlAttribute("type")]
		public GroupType Type { get; set; }
		
		/// <summary>
		/// A list of <see cref="Member.ID">id</see>s of members to add
		/// to the group
		/// </summary>
		[XmlArrayItem("ID")]
		public string[] Members { get; set; }

		/// <summary>
		/// An optional list of attributes to set for the created LDAP item
		/// </summary>
		[XmlArrayItem("Attribute")]
		public ActiveDirectoryAttribute[] Attributes { get; set; }
	}
}